package fr.upstlse.glre.client.vo.user;

import com.extjs.gxt.ui.client.widget.Html;
import com.google.gwt.user.client.rpc.IsSerializable;

public class UserVOGWT implements IsSerializable {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -545297464894512677L;
	private long id;
	private String login;
	private String password;
	private String role;
	
	public UserVOGWT() {
		id = 0;
		login = null;
		password = null;
		role = null;
	}
	
	public UserVOGWT(long id, String login, String password, String role) {
		this.id = id;
		this.login = login;
		this.password = password;
		this.role = role;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}
	
	public Html getHtml() {
		String lLogin = "<p>Login: " + getLogin() + "</p>";
		String lPassword = "<p>Mot de passe: " + getPassword() + "</p>";
		String lRole = "<p>Role: " + getRole() + "</p>";
		String lUser = lLogin + lPassword + lRole;
		
		Html lHTML = new Html();
		lHTML.setHtml(lUser);

		return lHTML;
	}
	
	public String toString() {
		String res = "";
		res += getLogin() + "\n";
		res += getPassword() + "\n";
		res += getRole() + "\n";
		return res;
	}
}
